<%-- 
    Document   : index
    Created on : 13-08-2014, 21:26:33
    Author     : NGOCLINH-PC
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="Data.Member"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    String user = (String) session.getAttribute("ssuser");
    if (user == "" || session.getAttribute("ssuser") == null) {
        response.sendRedirect("../admin/login.jsp");
    }


    Member m = new Member();
    ArrayList<Member> a = m.MselectByUser((String) session.getAttribute("ssuser"));
    if (a.size() > 0) {
        for (int i = 0; i < a.size(); i++) {
            Member pay = a.get(i);
            String membername = pay.getMemberName();
            int memberID = pay.getMemberID();

%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Admin Page</title>
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
        <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
        <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
        <link rel="stylesheet" type="text/css" href="css/style.css"/>
        <script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
        <script type="text/javascript">
            // $(function() {
            //    $("#datepicker").datepicker();
            //   $("#datepicker1").datepicker();
            // });
        </script>

    </head>
    <body>
        <div class="wapper"><!--wapper-->
            <div class="heard"><!--heard-->
                <div class="banner"><!--banner-->
                    <h3>Management website</h3>
                    <span>Welcome: <% out.print(membername);%><br /></span>
                    <ul>
                        <li><a href="../client/index.jsp" target="_blank"><img src="image/icon_look.png"  alt="iconlook"/><p>View website</p></a></li>
                                <% out.print("<li><a href='index.jsp?page=Profile&memID=" + memberID + "'><img src='image/icon_account.png'  alt='iconaccount'/><p>Profile</p></a></li>");%>
                        <li><a href="#"><img src="image/icon_setting.png"  alt="iconsetting"/><p>Setting</p></a></li>
                        <li><a href="../admin/Logout.jsp"><img src="image/icon_out.png"  alt="iconout"/><p>Exit</p></a></li>
                    </ul>
                </div><!-- end banner-->
                <div class="menu"><!--heard-->
                    <ul>
                        <li class="active"><a href="index.jsp">Home</a></li>
                            <% if (pay.getjob() != 1) {
                                    int job = pay.getjob();
                                    if (job % 2 == 0) {
                                        out.println("<li><a href='index.jsp?page=About'>About Us</a></li>");
                                    }
                                    if (job % 3 == 0) {
                                        out.println("<li><a href='index.jsp?page=Event'>Event</a></li>");
                                    }
                                    if (job % 5 == 0) {
                                        out.println("<li><a href='index.jsp?page=Subcriber'>Subcriber</a></li>");
                                    }
                                    if (job % 2 == 0) {
                                        out.println("<li><a href='index.jsp?page=Contact'>Contact Us</a></li>");
                                    }
                                    if (job % 11 == 0) {
                                        out.println("<li><a href='index.jsp?page=Category'>Category</a></li>");
                                    }
                                    if (job % 29 == 0) {
                                        out.println("<li><a href='index.jsp?page=Member'>Member</a></li>");
                                    }
                                }%>



                    </ul>
                </div><!--end menu-->
            </div><!--end heard-->
            <div class="menucontent"><!--menucontent-->
                <div class="menucontent1"><!--menucontent1-->
                    <ul>
                        <% if (pay.getjob() != 1) {
                                int job = pay.getjob();
                                if (job % 13 == 0) {
                                    out.println("<li class='none'><a href='index.jsp?page=Comment'>Comment</a></li>");
                                }
                                if (job % 17 == 0) {
                                    out.println("<li class='none'><a href='index.jsp?page=EnrollEvent'>Enroll Event</a></li>");
                                }
                                if (job % 29 == 0) {
                                    out.println("<li class='none'><a href='index.jsp?page=RoleType'>Role Type</a></li>");
                                }
                                if (job % 19 == 0) {
                                    out.println("<li class='none'><a href='index.jsp?page=Prize'>Prize</a></li>");
                                }
                                if (job % 19 == 0) {
                                    out.println("<li class='none'><a href='index.jsp?page=PrizeType'>Prize Type</a></li>");
                                }
                                if (job % 17 == 0) {
                                    out.println("<li class='none'><a href='index.jsp?page=PayType'>Pay Type</a></li>");
                                }
                            }
                        %>




                    </ul>
                </div><!--end menucontent1-->
            </div><!--end menucontent-->
            <div class="primary"><!--primary-->
                <%
                    if (request.getParameter(
                            "page") != null) {
                        String p = request.getParameter("page");
                        p = p + ".jsp";
                %>
                <jsp:include page="<%=p%>" />
                <%
                } else {
                %>
                <ul>
                    <li><a href="index.jsp"><img src="image/home_alt.png" alt="home" width="60" height="48"/><p>Home</p></a></li>
                            <% if (pay.getjob() != 1) {
                                    int job = pay.getjob();
                                    if (job % 2 == 0) {
                                        out.println(" <li><a href='index.jsp?page=About'><img src='image/icon_position.png' alt='home' width='60' height='48'/><p>About</p></a></li>");
                                    }
                                    if (job % 11 == 0) {
                                        out.println(" <li><a href='index.jsp?page=Category'><img src='image/icon_danmuc.png' alt='home' width='60' height='48'/><p>Category</p></a></li>");
                                    }
                                    if (job % 1 == 0) {
                                        out.println(" <li><a href='#'><img src='image/icon_config.png' alt='home' width='60' height='48'/><p>Setting</p></a></li>");
                                    }
                                    if (job % 7 == 0) {
                                        out.println(" <li><a href='index.jsp?page=Customers'><img src='image/icon_dskh.png' alt='home' width='60' height='48'/><p>Customers</p></a></li>");
                                    }
                                    if (job % 3 == 0) {
                                        out.println(" <li><a href='index.jsp?page=Event'><img src='image/icon_danmuc.png' alt='home' width='60' height='48'/><p>Event</p></a></li>");
                                    }
                                    if (job % 17 == 0) {
                                        out.println(" <li><a href='index.jsp?page=EnrollEvent'><img src='image/icon_5.png' alt='home' width='60' height='48'/><p>EnrollEvent</p></a></li>");
                                    }
                                    if (job % 5 == 0) {
                                        out.println(" <li><a href='index.jsp?page=Subcriber'><img src='image/icon_tintuc.png' alt='home' width='60' height='48'/><p>Subcriber</p></a></li>");
                                    }
                                    if (job % 19 == 0) {
                                        out.println(" <li><a href='index.jsp?page=Prize'><img src='image/1.png' alt='home' width='60' height='48'/><p>Prize</p></a></li>");
                                    }
                                    if (job % 2 == 0) {
                                        out.println(" <li><a href='index.jsp?page=Contact'><img src='image/icon_4.png' alt='home' width='60' height='48'/><p>Contact us</p></a></li>");
                                    }
                                    if (job % 13 == 0) {
                                        out.println(" <li><a href='index.jsp?page=Comment'><img src='image/comment-icon.png' alt='home' width='60' height='48'/><p>Comment</p></a></li>");
                                    }
                                }%>










                </ul>
                <%   }
                        }
                    }

                %>
            </div><!--end primary-->
            <div class="footer"  style="text-align:right; padding: 10px 20px 0 0"><span style="color: #31aaef; font-size: 17px;">Group 263 - C1109L Aptech</span></div>
        </div><!--end wapper-->

    </body>
</html>
